Skip to content

feat: Switch port - #433

Merged
Un1q32 merged 24 commits into
ButterscotchRunner:mainfrom
cobaltgit:nsw-round-2
Aug 26, 2026
Merged

feat: Switch port#433
Un1q32 merged 24 commits into
ButterscotchRunner:mainfrom
cobaltgit:nsw-round-2

Conversation

@cobaltgit

Copy link
Copy Markdown
Collaborator
image

Eden shenanigans

@cobaltgit

Copy link
Copy Markdown
Collaborator Author

Where the fuck is my audio

@cobaltgit

Copy link
Copy Markdown
Collaborator Author

NVM i'm stupid

@cobaltgit

Copy link
Copy Markdown
Collaborator Author

Issues:

  • it's upside down and trying to render in widescreen for 4:3 games
  • Deltarune STILL doesn't have sdl2 input fuck knows why

Comment thread src/switch/main.c Outdated
Comment thread CMakeLists.txt
Comment thread CMakeLists.txt
Comment thread src/switch/main.c Outdated
Comment thread CMakeLists.txt Outdated
option(ENABLE_LEGACY_GL "Enable the legacy OpenGL renderer" ON)
option(ENABLE_MODERN_GL "Enable the modern OpenGL renderer" ON)
if(PLATFORM STREQUAL "switch")
# The Switch only supports the modern GL renderer (GLES3 via SDL2)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm like 80% sure that the switch can do desktop OpenGL, so legacy-gl should work.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could probs work with glad, I'll have a look

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, switch doesn't have shared libraries and definitely no shared libGL, so glad won't work.

Comment thread src/switch/main.c Outdated
@cobaltgit

Copy link
Copy Markdown
Collaborator Author

Eden segfaults with OS_WINDOWS but not OS_SWITCH, Ryujinx doesn't boot it at all

@Un1q32

Un1q32 commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

do you have real hardware to test with?

@cobaltgit

cobaltgit commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator Author

Nah, I wish I did tho

For legal reasons I am totally lying

Comment thread CMakeLists.txt Outdated
add_compile_options(-ffast-math)
endif()

add_compile_definitions(__SWITCH__)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the dkp compiler define this by default?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test if removing this line breaks the build

@Un1q32

Un1q32 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Is this done?

@cobaltgit

Copy link
Copy Markdown
Collaborator Author

Not quite, unless I merge it in a half-done state and rip my hair out over inputs not working and forced widescreen rendering

@Un1q32

Un1q32 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

What about SDL 3?

@Un1q32

Un1q32 commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

or glfw3, the switch has a glfw3 port in dkp repos

@cobaltgit
cobaltgit marked this pull request as ready for review August 25, 2026 16:31
@cobaltgit cobaltgit changed the title some kind of switch port that uses the new thing feat: Switch port Aug 25, 2026
@cobaltgit

Copy link
Copy Markdown
Collaborator Author
image

All is good in the world

@Un1q32
Un1q32 merged commit 29c4acf into ButterscotchRunner:main Aug 26, 2026
57 of 58 checks passed
emiyl pushed a commit to emiyl/Butterscotch that referenced this pull request Aug 27, 2026
* some kind of switch port that uses the new thing

* who invited my man blud

* fix audio

* switch: don't use gamecontrollerdb

* pls help

* remove dupe args

* correct dkp cmake toolchain path

* load in memory aot

* we already set the cmake toolchain for dkp, no need for this

* make switch use glad

* nvm, stick to glesv2

* force off legacy gl on switch

* try this

* fix segv

* libnx input and sdl2 window size

* nintendo facebutton layout

* remove stray romfs exit

* add switch to readme

* change file location

---------

Co-authored-by: Un1q32 <joey.t.reinhart@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants